#include "NetProcessMgr.h"

CNetProcessMgr::CNetProcessMgr(void)
{
	m_apkNetMsgProc.clear();
}

CNetProcessMgr::~CNetProcessMgr(void)
{
	m_apkNetMsgProc.clear();
}

bool CNetProcessMgr::UnRegisterMsgProc( int iMsgID )
{	
	return false;
}

void CNetProcessMgr::RegisterProc( int iMsgID,NetMsgProc pFunc )
{
	m_apkNetMsgProc[iMsgID] = pFunc;
}

bool CNetProcessMgr::FireProc( int iMsgID,const void* pkData,int iLen,bool bFixedMsg )
{
	NetMsgProc pFunc = m_apkNetMsgProc[iMsgID];

	bool bRet = false;
	if (pFunc == NULL)
	{
		bRet = UnRegisterMsgProc(iMsgID);
	}
	else
	{
		bRet = pFunc(pkData,iLen,bFixedMsg);
	}

	return bRet;
}